package com.hi5;

import java.util.List;

/**
 * Basic utilities.
 * @author mate
 *
 */
public class Utils {
    /**
     * Checks a collection whether it is empty.
     *
     * @param list the list to check
     * @return {@code true} if list is {@code null} or has not any element
     */
    public static boolean isEmpty(List<?> list) {
        return list == null || list.isEmpty();
    }

    /**
     * Checks a string whether it is empty.
     * @param s the string to check
     * @return {@code true} when s is {@code null} or is an empty string
     */
    public static boolean isEmpty(String s) {
        return s == null || s.isEmpty();
    }

}
